home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_04
/
1004090a
< prev
next >
Wrap
Text File
|
1992-02-08
|
394b
|
22 lines
#include <stdio.h>
#include <stdlib.h>
#define NUMELEMENTS(x) (sizeof(x)/sizeof(x[0]))
typedef struct {
const char *stack_name;
int *pstack;
size_t stack_ptr;
size_t max_stack;
} stack;
int array1[1];
static int array2[30];
stack stack1 = {"stack1", array1, 0, NUMELEMENTS(array1)};
stack stack2 = {"stack2", array2, 0, NUMELEMENTS(array2)};
stack stack3 = {"stack3", NULL, 0, 0};